package com.aloda.exception;

import com.aloda.constant.ErrorCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class BaseException extends RuntimeException{

    private Integer errorCode;

    public BaseException() {
    }

    public BaseException(String message){
        super(message);
        this.errorCode = 0;
    }

    public BaseException(Integer errorCode, String message){
        super(message);
        this.errorCode = errorCode;
    }

    public BaseException(ErrorCode errorCode){
        super(errorCode.getMessage());
        this.errorCode = errorCode.getCode();
    }
}
